program D4;

{$APPTYPE CONSOLE}

type
  pelement=^element;
  element=record
    value: integer;
    next: pelement;
  end;
var
  i, n: integer;
  head, h, tmp: pelement;
  fin: textFile;

procedure D (var f: pelement);
var
  tmp: pelement;
begin
  tmp:=f^.next^.next^.next^.next;
  dispose(f^.next^.next^.next);
  f^.next^.next^.next:=tmp;
  while (f<> nil) do
  begin
    writeln(f^.value);
    f:=f^.next;
  end

end;

begin
  assign(fin, 'input.txt');
  reset(fin);
  readln(fin, n);
  new(head);
  h:=head;
  read(fin, head^.value);
  for i:=0 to n-2 do
  begin
    new(head^.next);
    head:=head^.next;
    read(fin, head^.value);
  end;
  head^.next:=nil;
  if (n>=4) then
    D(h);
  readln;
end.
